#include <bits/stdc++.h>

using namespace std;
const int N=100010;
int sum[N]={0};
int n,S,nearS=100000010;
int upperBound(int left,int right,int x)
{
    int mid;
    while (left<right)
    {
        mid=left+(right-left)/2;
        if (sum[mid]>x)
        {
            right=mid;
        }
        else
        {
            left=mid+1;
        }
    }
    return left;
}
int main_1044()
{
    scanf("%d %d",&n,&S);
    sum[0]=0;
    for (int i=1;i<=n ;++i )
    {
        scanf("%d",&sum[i]);
        sum[i]+=sum[i-1];
    }
    for (int i=1;i<=n ;++i )
    {
        int j=upperBound(i,n+1,sum[i-1]+S);
        if (sum[j-1]-sum[i-1]==S)
        {
            nearS=S;
            break;
        }else if(sum[j]-sum[i-1]<nearS)
        {
            nearS=sum[j]-sum[i-1];
        }
    }
    for (int i=1;i<=n ; ++i)
    {
        int j=upperBound(i,n+1,sum[i-1]+nearS);
        if (sum[j-1]-sum[i-1]==nearS)
        {
            printf("%d-%d\n",i,j-1);
        }
    }
    return 0;
}
